@echo off
REM 设置UTF-8编码，防止汉字乱码
chcp 65001 > nul
REM 设置进程名称
set processName=OneCard.WinApp.exe
set logFile=%cd%\log.txt
tasklist /fi "imagename eq %processName%" 2>NUL | find /i /n "%processName%">NUL
if "%ERRORLEVEL%"=="0" (
    echo [%date% %time%] 应用程序正在运行
    echo [%date% %time%] 应用程序正在运行 >> %logFile%
) else (
    echo [%date% %time%] 应用程序没有运行
    echo [%date% %time%] 应用程序没有运行 >> %logFile%
    REM 发送通知
    curl http://122.112.200.67:8133/dingTalk/sendTextMessage -o result.txt
    if exist result.txt (
        type result.txt
    ) else (
        echo [%date% %time%] 请求失败消息通知接口失败 >> %logFile%
    )
)
pause